home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Aminet
/
util
/
boot
/
sdate10_src.lha
/
StartupDate.e
Wrap
Text File
|
1999-01-23
|
2KB
|
72 lines
/* This is the source code file for my program StartupDate which
allows you to set the date on startup. It can be compiled with the
Amiga E compiler using the standard options - no extra files are
needed. To see instructions for the program see the readme and
AmigaGuide files in the binary archive.
This code has been release as open-source. You can modify it and
recompile it as you wish. I may upgrade this software in the future
but I hold now claims over modified versions resulting from this
source code.
This program is rather basic but feel free to change it how you see
fit.
Jonathan Combe 23/1/99
*/
/* Set up variables */
DEF usdate[10] : STRING /* Stores the user entered date */
DEF ustime[10] : STRING /* Stores the user entered time */
DEF outstring[30] : STRING /* Stores the string which is output to the date command */
DEF fh /* File handler */
/* Main function */
PROC main()
getinput()
makestring()
setdate()
displaydate()
ENDPROC
/* Gets user input - NO error checking */
PROC getinput()
WriteF('StartupDate V1.0 ©1997 Jonathan Combe\n')
WriteF('\n')
WriteF('Please enter todays date in the from DD-Mth-YY, E.G. 15-Jun-97\n')
fh:=IF stdin THEN stdin ELSE stdout
ReadStr(fh,usdate)
WriteF('Please enter the current in time in the form HH:MM:SS\n')
WriteF('Please use the 24 hour clock.\n')
fh:=IF stdin THEN stdin ELSE stdout
ReadStr(fh,ustime)
ENDPROC
/* Make up a suitable string for passing to the AmigaDos date command
from the users input */
PROC makestring()
StrCopy(outstring,'Date ',ALL)
StrAdd(outstring,usdate,ALL)
StrAdd(outstring,' ',ALL)
StrAdd(outstring,ustime,ALL)
ENDPROC
/* Set the date by calling the AmigaDos date command with the string */
PROC setdate()
Execute (outstring,0,0)
ENDPROC
/* Execute the date command once more to display the new date - useful
for user verification */
PROC displaydate()
WriteF('\n')
Execute ('Date',0,0)
ENDPROC